package org.dromara.system.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.system.domain.WbItemInfo;
import org.dromara.system.domain.bo.WbItemInfoBo;
import org.dromara.system.domain.dto.NumDTO;
import org.dromara.system.domain.dto.WbCandidateListDTO;
import org.dromara.system.domain.vo.WbCandidateListVo;
import org.dromara.system.domain.vo.WbItemInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.system.domain.vo.WbMinuteListVo;

import java.util.List;

/**
 * 项目Mapper接口
 *
 * @author Lion Li
 * @date 2024-03-22
 */
public interface WbItemInfoMapper extends BaseMapperPlus<WbItemInfo, WbItemInfoVo> {

    List<WbItemInfoVo> queryListItemLogs(WbItemInfoBo bo, Long userId, Page<Object> build);

    void deleteAll();

    boolean insertByBoList(List<WbItemInfo> wbItemInfoBos);



    List<WbItemInfoVo> queryListA(LambdaQueryWrapper<WbItemInfo> lqw);


    /**
     * 更新项目状态
     *
     */
    void  updateStatus();

    /**
     * 自定义分页查询
     * @param enterpriseId
     * @param build
     * @param lqw
     * @return
     */
    Page<WbItemInfoVo> selectVoPageZdy(@Param("enterpriseId") Long enterpriseId, @Param("page") Page<Object> build, @Param(Constants.WRAPPER) LambdaQueryWrapper<WbItemInfo> lqw);

    /**
     * 自定义查询所有信息
     * @param enterpriseId
     * @param
     * @return
     */
    Page<WbCandidateListDTO> selectVoListZdy(@Param("enterpriseId") Long enterpriseId,@Param("page") Page<Object> build);

    /**
     * 分页查询（带上我的关注状态）
     * @param build
     * @param lqw
     * @return
     */
    Page<WbItemInfoVo> selectVoPageWithFollow(@Param("userId") Long userId, @Param("page") Page<Object> build, @Param(Constants.WRAPPER) LambdaQueryWrapper<WbItemInfo> lqw);

    /**
     * 查询投标信息
     * @param itemID
     * @return
     */
    WbItemInfoVo queryGenerateBYId(@Param("itemId") Long itemID);

    Page<WbItemInfoVo> selectListAllBidsWon(@Param("page") Page<Object> build);

    Page<WbMinuteListVo> selectListAllBidsWonZTY(Long enterpriseId,String name,@Param("page")Page<Object> build);

    List<WbCandidateListDTO> selectVoListZ(Long enterpriseId, Long userId);

    List<NumDTO> selectCountNum();
}
